﻿<div ng-controller="BannerDetailController">
    <div class="wrapper-md" >
        <div class="panel panel-default">
        <form class="form-horizontal ng-pristine ng-valid ng-valid-date ng-valid-required ng-valid-parse ng-valid-date-disabled" ng-submit="submit()">
            <div class="panel-body">
                <div class="form-group">
                  <label class="col-sm-2 control-label">名称</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" ng-model="data.name" required>
                  </div>
                </div>
            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">banner主图url</label>
                    <div class="col-sm-10">
                        <label>
                            <img ng-src="{{data.imageUrl}}"/>
                        </label>
                        <label>
                            <input type="file" id="one-input" accept="image/*" file-model="images" onchange="angular.element(this).scope().img_upload(this.files)"/>
                        </label>
                    </div>
                </div>
            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">跳转url</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" ng-model="data.targetUrl" required>
                    </div>
                </div>
            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">位置</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" ng-model="data.position" required onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                    </div>
                </div>
            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">类型</label>
                    <div class="col-sm-4">
                        <select class="form-control m-b" ng-model="data.type" required>
                            <option value="1">首页显示</option>
                            <option value="2">跳转外链url</option>
                            <option value="3">跳转详情</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">对应id</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" ng-model="data.targetId" required onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                    </div>
                </div>
            </div>
            <footer class="panel-footer text-right bg-light lter">
                    <input type="button" ng-click="delete()" ng-if="edit_mode" class="btn btn-danger pull-left" value="删除"/>
                      <input type="submit" class="btn btn-success" value="提交"/>
             </footer>
         </form>
      </div>
    </div>
</div>